window.onload = function() {

	document.title = "鼎尚国际";
	
	/*判断是否为手机端*/
	function isWap() {
		var userAgentInfo = navigator.userAgent;
		var Agents = ["Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod"];
		var flag = false;
		for(var v = 0; v < Agents.length; v++) {
			if(userAgentInfo.indexOf(Agents[v]) > 0) {
				flag = true;
				break;
			}
		}
		return flag;
	}
	if(isWap()) {
		window.location.href = '../h5/index.html';
	}
	
	
    $(document).ready(function () {
        $(".down").hover(function () {
            $(".ewm").css('display', 'block');
        }, function () {
            $(".ewm").css('display', 'none');
        });

        $(".ewm").hover(function () {
            $(this).css('display', 'block');;
        }, function () {
            $(this).css('display', 'none');
        });
    })


	function makeCode() {
		var qrcode = new QRCode(document.getElementById("qrcode"), {
			width: 190,
			height: 190,
			colorDark: "#000000",
			colorLight: "#ffffff",
			correctLevel: QRCode.CorrectLevel.H
		});
		
		var elText = window.location.host;

		if(!elText) {
			// alert("Input a text");
			elText.focus();
			return;
		}

		var url = "http://" + elText + "/h5/index.html";
		qrcode.makeCode(url);
		
		$("#text").
		on("blur", function() {
			makeCode();
		}).
		on("keydown", function(e) {
			if(e.keyCode == 13) {
				makeCode();
			}
		});
	}

	makeCode();
	
	
}